#include <iostream>

using std::cout;
using std::endl;
using std::string;

int main()
{
    string s1 = "hello";
    string s2 = "helloworldaaaaa";
    string s3 = "helloworldaaaaab";
    string s4 = "helloworldaaaaabcccccccccccccccccccccccccccccccccccccccc";
    cout << "sizeof(string):" << sizeof(string) << endl;
    cout << "s1' size:" << s1.size() << endl;
    cout << "s1:" << s1 << endl;
    cout << "&s1:" << &s1 << endl;
    printf("s1's content: %p\n", s1.c_str());
    cout << endl;

    cout << "s2' size:" << s2.size() << endl;
    cout << "s2:" << s2 << endl;
    cout << "&s2:" << &s2 << endl;
    printf("s2's content: %p\n", s2.c_str());

    cout << endl;
    cout << "s3' size:" << s3.size() << endl;
    cout << "s3:" << s3 << endl;
    cout << "&s3:" << &s3 << endl;
    printf("s3's content: %p\n", s3.c_str());

    cout << endl;
    cout << "s4' size:" << s4.size() << endl;
    cout << "s4:" << s4 << endl;
    cout << "&s4:" << &s4 << endl;
    printf("s4's content: %p\n", s4.c_str());

    string s5 = s4;//深拷贝
    cout << "s5:" << s5 << endl;
    printf("s5's content: %p\n", s5.c_str());
    return 0;
}

